import { defRequest } from '../utils/request'

const getPdtaskplanList = (params: any) => {
  return defRequest.post<any>('/omo/omoPdtaskplan/list', params, { showLoading: false, timeout: 50000 })
}

const getPdtaskplanPage = (params: any) => {
  return defRequest.post<any>('/omo/omoPdtaskplan/listPage', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getWorkticketList = (params: any) => {
  return defRequest.post<any>('/omo/omoWorkticket/list', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getWorkticketPage = (params: any) => {
  return defRequest.post<any>('/omo/omoWorkticket/listPage', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}
const getSaferiskList = (params: any) => {
  return defRequest.post<any>('/omo/omoSaferisk/list', params, { showLoading: false, timeout: 50000 })
}

const getLoadforecaseList = (params: any) => {
  return defRequest.post<any>('/omo/omoLoadforecase/list', params, { showLoading: false, timeout: 50000 })
}

const getCoalinoutLastData = (params: any) => {
  return defRequest.post<any>('/omo/omoCoalinout/getLastOne', params, { showLoading: false, timeout: 50000 })
}

const getSeasonctrlList = (params: any) => {
  return defRequest.post<any>('/omo/omoSeasonctrlDetail/list', params, { showLoading: false, timeout: 50000 })
}

const getCoalblendList = (params: any) => {
  return defRequest.post<any>('/omo/omoCoalblend/list', params, { showLoading: false, timeout: 50000 })
}
const getCoalvarietyList = (params: any) => {
  return defRequest.post<any>('/omo/omoCoalvariety/list', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getTechsuperList = (params: any) => {
  return defRequest.post<any>('/omo/omoTechsuper/list', params, { showLoading: false, timeout: 50000 })
}

const getSisIndexList = (params: any) => {
  return defRequest.post<any>('/omo/omoIndex/list', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getCurrentShiftTask = (params: any) => {
  return defRequest.post<any>('/omo/regulartask/getCurrentShiftTask', params, { showLoading: false, timeout: 50000 })
}

//取多源供热的指标数据
const getMultiheatList = (params: any) => {
  return defRequest.post<any>('/omo/omoMultiheat/list', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getLoadCurve = (params: any) => {
  return defRequest.post<any>('/tdengine/sisdata/loadcurve', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getLoadCurveByRedis = (params: any) => {
  return defRequest.post<any>('/tdengine/sisdata/getLoadCurveByRedis', params, { showLoading: false, timeout: 50000 })
}

const getEventAlarmReport = (params: any) => {
  return defRequest.post<any>('/hik/hikEventalarm/getEventAlarmReport', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getPersonWarnInfo = (params: any) => {
  return defRequest.get<any>('znaf/f/workWarnInfo/getPersonWarnInfo', params, {
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

const getFileByteArray = (params: any) => {
  return defRequest.getfileBlob<any>('/hik/hikEventalarm/getFileByteArray', params, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000,
    responseType: 'blob'
  })
}

const getAreaWarnInfo = (params: any) => {
  return defRequest.get<any>('znaf/f/workWarnInfo/getAreaWarnInfo', params, {
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    showLoading: false,
    timeout: 50000
  })
}

export default {
  getPdtaskplanList,
  getWorkticketList,
  getSaferiskList,
  getLoadforecaseList,
  getCoalinoutLastData,
  getSeasonctrlList,
  getCoalblendList,
  getTechsuperList,
  getCurrentShiftTask,
  getLoadCurve,
  getLoadCurveByRedis,
  getSisIndexList,
  getMultiheatList,
  getCoalvarietyList,
  getPdtaskplanPage,
  getWorkticketPage,
  getEventAlarmReport,
  getPersonWarnInfo,
  getAreaWarnInfo,
  getFileByteArray
}
